﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OgilvyOne.Sharan.Web._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language=javascript src="Scripts/jquery-1.4.1.min.js"></script>
    <script language=javascript>
    <!--
        function WeiboLoginWindow(clientID) {
            this.clientID = clientID;
            this.open = function (redirectUrl) {
                window.open("https://api.weibo.com/oauth2/authorize?client_id=" + this.clientID + "&response_type=token&redirect_uri=" + redirectUrl, "WeiboLogin", "height=480,width=640");
            }
        }

        function logonToSinaWeibo() {
            var clientID = document.getElementById("hdnClientID").value;
            var redirectUrl = document.getElementById("hdnRedirectUrl").value;
            var win = new WeiboLoginWindow(clientID);
            win.open(redirectUrl);
        }

        function getKOLWeiboData() {
            var url = 'XmlHttpGate.aspx';
            jQuery.ajax({
                url: url,
                dataType: 'xml',
                success: function (doc) { $('#divNotify').hide('slow') ; alert(doc.xml); }
            });

            $('#divNotify').show('slow');
        }

        function loadPage() {
            window.location.reload(true);
        }

        function logout() {
            var url = 'XmlHttpGate.aspx?op=logout';
            jQuery.ajax({
                url: url,
                dataType: 'xml',
                success: function (doc) { alert('账户已注销'); }
            });
        }

        function getUsers() {
            
        }
    //-->
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <input type=hidden runat=server id="hdnWeibo" />
    <div>
        <input type=button value="登录新浪微博" onclick="javascript:logonToSinaWeibo();" />
        <input type=button value="获取KOL微博数据" onclick="javascript:getKOLWeiboData();" />
        <input type=button value="退出微博" onclick="javascript:logout();" />
        <input type=button value="数据维护" onclick="javascript:getUsers();" />
        <div id="divNotify" style="display:none">正在获取KOL微博数据...</div>
        <asp:FileUpload runat=server ID="fu1" />
        <asp:Button runat=server ID="btnUpload" OnClick="btnUpload_click" />
    </div>
    </form>
</body>
<script language=javascript>
<!--
    //init();
//-->
</script>
</html>
